#include<bits/stdc++.h>
using namespace std;
int s[100005];
int big=-1;
int x;
int n;
int sum;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&x);
        s[x]++;
        if(x>big) big=x;

    }
    sum=n;
    for(int i=2;i<=big;i++)
    {
        if(s[i]>=s[i-1])
        {
            sum=sum-s[i-1];
        }
        else
        {
            sum=sum-s[i];
            s[i]=s[i-1];
        }
    }
    printf("%d",sum);
    fclose(stdin);
    fclose(stdout);
    return 0;
}
